package util;


import java.io.File;
import java.util.ArrayList;

public class FileDirectoryHandler {
	static File filename;

	public static ArrayList<String> list = new ArrayList<String>();
	
	public static void rootList(String fname){
		filename = new File(fname);
		try{
			if(!filename.isDirectory()){
				getList().add(fname);
				return;
			}
			String filelist[] = filename.list();
			for(int i = 0; i < filelist.length; i++){
				rootList(fname + File.separator + filelist[i]);
			}
		}catch(Exception e){
			System.out.println("Error while getting files");
		}
		
	}

	public static ArrayList<String> getList() {
		return list;		
	}
	
	public void setList(ArrayList<String> aList){
		list = aList;
	}
}
